/*
 Navicat Premium Data Transfer

 Source Server         : LocalDB
 Source Server Type    : SQL Server
 Source Server Version : 15004153
 Source Host           : (localdb)\MSSQLLocalDB:1433
 Source Catalog        : OcelotSettings
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 15004153
 File Encoding         : 65001

 Date: 07/07/2023 17:31:06
*/


-- ----------------------------
-- Table structure for Route
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Route]') AND type IN ('U'))
	DROP TABLE [dbo].[Route]
GO

CREATE TABLE [dbo].[Route] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [ProjectId] int  NOT NULL,
  [DownstreamPathTemplate] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [UpstreamPathTemplate] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [UpstreamHttpMethod] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DownstreamHttpMethod] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [DownstreamHttpVersion] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [RequestIdKey] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [RouteIsCaseSensitive] bit  NULL,
  [ServiceName] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ServiceNamespace] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [DownstreamScheme] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [Cache_TtlSeconds] int  NULL,
  [Cache_Region] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qos_ExceptionsAllowedBeforeBreaking] int  NULL,
  [Qos_DurationOfBreak] int  NULL,
  [Qos_TimeoutValue] int  NULL,
  [LoadBalancer_Type] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LoadBalancer_Key] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LoadBalancer_Expiry] int  NULL,
  [RateLimit_EnableRateLimiting] bit  NULL,
  [RateLimit_Period] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [RateLimit_PeriodTimespan] decimal(38)  NULL,
  [RateLimit_Limit] bigint  NULL,
  [RateLimit_WhiteList] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [Authentication_AuthenticationProviderKey] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Authentication_AllowedScopes] nvarchar(300) COLLATE Chinese_PRC_CI_AS  NULL,
  [HttpHandler_AllowAutoRedirect] bit  NULL,
  [HttpHandler_UseCookieContainer] bit  NULL,
  [HttpHandler_UseTracing] bit  NULL,
  [HttpHandler_UseProxy] bit  NULL,
  [HttpHandler_MaxConnectionsPerServer] int  NULL,
  [UpstreamHost] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Key] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [DelegatingHandlers] nvarchar(300) COLLATE Chinese_PRC_CI_AS  NULL,
  [Priority] int  NULL,
  [Timeout] int  NULL,
  [DangerousAcceptAnyServerCertificateValidator] bit  NULL,
  [Security_IPAllowedList] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [Security_IPBlockedList] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [Enabled] bit  NOT NULL,
  [Sort] int DEFAULT 0 NULL
)
GO

ALTER TABLE [dbo].[Route] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目Id',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'ProjectId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'下游的路由模板，即真实处理请求的路径模板',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'DownstreamPathTemplate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上游请求的模板，即用户真实请求的链接',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'UpstreamPathTemplate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上游请求的http方法（数组：GET、POST、PUT）',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'UpstreamHttpMethod'
GO

EXEC sp_addextendedproperty
'MS_Description', N'下游请求的http方法（数组：GET、POST、PUT）',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'DownstreamHttpMethod'
GO

EXEC sp_addextendedproperty
'MS_Description', N'下游Http版本',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'DownstreamHttpVersion'
GO

EXEC sp_addextendedproperty
'MS_Description', N'请求Id',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'RequestIdKey'
GO

EXEC sp_addextendedproperty
'MS_Description', N'开启上下游路由模板大小写匹配',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'RouteIsCaseSensitive'
GO

EXEC sp_addextendedproperty
'MS_Description', N'服务发现名称',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'ServiceName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'服务发现命名空间',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'ServiceNamespace'
GO

EXEC sp_addextendedproperty
'MS_Description', N'请求的方式，如：http,htttps',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'DownstreamScheme'
GO

EXEC sp_addextendedproperty
'MS_Description', N'请求缓存过期时间（需使用Ocelot.Cache.CacheManager）',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Cache_TtlSeconds'
GO

EXEC sp_addextendedproperty
'MS_Description', N'缓存区域（需使用Ocelot.Cache.CacheManager）',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Cache_Region'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Qos_ExceptionsAllowedBeforeBreaking'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Qos_DurationOfBreak'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Qos_TimeoutValue'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'LoadBalancer_Type'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'LoadBalancer_Key'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'LoadBalancer_Expiry'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用流量限制',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'RateLimit_EnableRateLimiting'
GO

EXEC sp_addextendedproperty
'MS_Description', N'限流周期（如：1s、1m、1h）',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'RateLimit_Period'
GO

EXEC sp_addextendedproperty
'MS_Description', N'恢复等待时间',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'RateLimit_PeriodTimespan'
GO

EXEC sp_addextendedproperty
'MS_Description', N'时间周期内允许访问的最大次数',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'RateLimit_Limit'
GO

EXEC sp_addextendedproperty
'MS_Description', N'限流白名单',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'RateLimit_WhiteList'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Authentication_AuthenticationProviderKey'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Authentication_AllowedScopes'
GO

EXEC sp_addextendedproperty
'MS_Description', N'允许自动跳转',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'HttpHandler_AllowAutoRedirect'
GO

EXEC sp_addextendedproperty
'MS_Description', N'使用Cookie容器',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'HttpHandler_UseCookieContainer'
GO

EXEC sp_addextendedproperty
'MS_Description', N'使用链路追踪',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'HttpHandler_UseTracing'
GO

EXEC sp_addextendedproperty
'MS_Description', N'使用代理',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'HttpHandler_UseProxy'
GO

EXEC sp_addextendedproperty
'MS_Description', N'服务最大连接数 ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'HttpHandler_MaxConnectionsPerServer'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'UpstreamHost'
GO

EXEC sp_addextendedproperty
'MS_Description', N'委托处理',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'DelegatingHandlers'
GO

EXEC sp_addextendedproperty
'MS_Description', N'路由节点优先级',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Priority'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Timeout'
GO

EXEC sp_addextendedproperty
'MS_Description', N'评估危险服务器认证',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'DangerousAcceptAnyServerCertificateValidator'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Security_IPAllowedList'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Security_IPBlockedList'
GO

EXEC sp_addextendedproperty
'MS_Description', N' ',
'SCHEMA', N'dbo',
'TABLE', N'Route',
'COLUMN', N'Enabled'
GO

EXEC sp_addextendedproperty
'MS_Description', N'路由主表',
'SCHEMA', N'dbo',
'TABLE', N'Route'
GO


-- ----------------------------
-- Auto increment value for Route
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Route]', RESEED, 152)
GO


-- ----------------------------
-- Primary Key structure for table Route
-- ----------------------------
ALTER TABLE [dbo].[Route] ADD CONSTRAINT [PK__Route__3214EC07D45E5C92] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO

